package com.gxa.modules.mapper.accessmapper;

import com.gxa.common.R;
import com.gxa.modules.pojo.Resource;
import com.gxa.modules.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {

    public List<Role> selectRole(@Param("roleName") String roleName,
                                 @Param("startIndex") int statrIndex,
                                 @Param("endIndex") int endIndex);
    public String selectRoleNameById(@Param("id") String id);
    public List<Resource> findResourceByRoleId(@Param("roleId") long roleId);

    public int insertRole(Role role);
    public int insertPermissions(@Param("roleId") long roleId,
                                 @Param("resourceId") String resourceId);

    public int deleteRole(@Param("roleId") String roleId);
    public int deletePermissions(@Param("roleId") String roleId);

    public int updateRole(Role role);

}
